******************************
* Table A5: ITT effects of DFS on Hemoglobin and Anemia (without child fixed effects)
*wave is labeled as post
************************
clear all
set trace off
set more off
use Jehanabad_analytic_sample_hemoglobin.dta
label variable hemoglobin "child hemoglobin level"


global socio_cov_4_vari no_HHmembers years_schooling_father years_schooling_mother asset_index

global school_cov_4_vari total_enrollment class_size student_teacher_ratio


g base_hb=hemoglobin if wave==0
replace base_hb=0 if base_hb==.
bys child_unique: egen hb_total=total(base_hb)
replace base_hb=hb_total if base_hb==0
g dfemale=(sex_child==0)
g bl_anemic= base_hb < 11.5
g hindu=(hc_1_household_religon==1)

sort school_id child_no wave
g base_hb1=hemoglobin
replace base_hb1=hemoglobin[_n-1] if wave==1

sort school_id child_no wave
g el_hb=hemoglobin
replace el_hb=hemoglobin[_n+1] if wave==0

g non_anemic =(base_hb >=11.5)
g bl_mild_an=(base_hb < 11.5 & base_hb >=11)
g bl_severe_an=(base_hb < 11)

g el_att= total_attendance_2
replace el_att= total_attendance_2[_n+1] if wave==0
bys school_id: egen school_el_att=mean(el_att)


g base_hb_time = base_hb*wave /*making time invariant to time variant by interacting baseline control with time */

g post=wave
label var post "Post"  /* Post denotes endline survey */
g treat_post=treat*post
label var treat_post "Treat*post"
label var treat "Treat"

*** Calculate Mean of dependent variable, baseline**
su hemoglobin any_an mild_an mod_sev_an if wave==0


* This table estimates the main model without chiild fe

reg hemoglobin treat_post post treat, cluster(school_id)

outreg2 using tableA5.doc, word label replace ctitle(Hemoglobin)  dec(3) keep(treat_post post treat) ///
addtext(Control variables, No)  ///
addnote(Notes: Estimated coefficients are based on a DD model estimated separately in each column. All, columns include child ///
"fixed effects and time-variant household controls (household size, mother's and father's years of", "schooling, and, asset index), and school-level controls: total enrollment, class size,", ///
and student-teacher ratio. The asset index was generated using the first component of the Principal Component Analysis consisting of several household assets. , ///
"Any anemia is defined as a hemoglobin value < 11.5 g/dl, mild anemia is defined as a hemoglobin value >= 11 & < 11.5 g/dl, moderate/severe anemia is defined", ///
"as a hemoglobin value < 11 g/dl. *, **, *** denote significance at the 10%, 5%, and 1% levels, respectively. Standard errors, clustered at the school level, are reported in parentheses.") ///
title(Table A5: ITT effects of DFS on Hemoglobin and Anemia (without child fixed effects)) nonotes nocons nor2 

reg hemoglobin treat_post treat post  $socio_cov_1_vari $school_cov_4_vari, cluster (school_id)
outreg2 using tableA5.doc, word label append ctitle(Hemoglobin)  dec(3) keep(treat_post post treat) ///
addtext(Control variables, Yes) nocons nor2 

reg any_an treat_post post treat, cluster(school_id)
outreg2 using tableA5.doc, word label append ctitle("Any anemia")  dec(3) keep(treat_post post treat) ///
addtext(Control variables, No) nocons nor2 

reg any_an treat_post treat post  $socio_cov_1_vari $school_cov_4_vari, cluster (school_id)
outreg2 using tableA5.doc, word label append ctitle("Any anemia")  dec(3) keep(treat_post post treat) ///
addtext(Control variables, Yes) nocons nor2 

reg mild_an treat_post post treat, cluster(school_id)
outreg2 using tableA5.doc, word label append ctitle(Mild anemia)  dec(3) keep(treat_post post treat) ///
addtext(Control variables, No) nocons nor2 

reg mild_an treat_post treat post  $socio_cov_1_vari $school_cov_4_vari, cluster (school_id)
outreg2 using tableA5.doc, word label append ctitle(Mild anemia)  dec(3) keep(treat_post post treat) ///
addtext(Control variables, Yes) nocons nor2 

reg mod_sev_an treat_post post treat, cluster(school_id)
outreg2 using tableA5.doc, word label append ctitle(Moderate or severe anemia)  dec(3) keep(treat_post post treat) ///
addtext(Control variables, No) nocons nor2 

reg mod_sev_an treat_post treat post  $socio_cov_1_vari $school_cov_4_vari, cluster (school_id)
outreg2 using tableA5.doc, word label append ctitle(Moderate or severe anemia)  dec(3) keep(treat_post post treat) ///
addtext(Control variables, Yes) nocons nor2 




********************************************End of do file *******************

  

